package lng.site.tatoo.dao;

import java.util.List;
import java.sql.Timestamp;

import lng.site.tatoo.IDao.TatooUserIDAO;
import lng.site.tatoo.model.TatooUser;

import org.hibernate.criterion.Restrictions;

/**
*
 */
public class TatooUserDAO extends
		AbstractDAO<TatooUser, Integer> implements
		TatooUserIDAO {

	/**
	 * Find TatooUser by name
	 */
	public List<TatooUser> findByName(String name) {
		return findByCriteria(Restrictions.eq("name", name));
	}
	
	/**
	 * Find TatooUser by surname
	 */
	public List<TatooUser> findBySurname(String surname) {
		return findByCriteria(Restrictions.eq("surname", surname));
	}
	
	/**
	 * Find TatooUser by login
	 */
	public List<TatooUser> findByLogin(String login) {
		return findByCriteria(Restrictions.eq("login", login));
	}
	
	/**
	 * Find TatooUser by pwd
	 */
	public List<TatooUser> findByPwd(String pwd) {
		return findByCriteria(Restrictions.eq("pwd", pwd));
	}
	
	/**
	 * Find TatooUser by telephone
	 */
	public List<TatooUser> findByTelephone(String telephone) {
		return findByCriteria(Restrictions.eq("telephone", telephone));
	}
	
	/**
	 * Find TatooUser by email
	 */
	public List<TatooUser> findByEmail(String email) {
		return findByCriteria(Restrictions.eq("email", email));
	}
	
	/**
	 * Find TatooUser by datecreation
	 */
	public List<TatooUser> findByDatecreation(Timestamp datecreation) {
		return findByCriteria(Restrictions.eq("datecreation", datecreation));
	}
	

}
